package com.flow.demo.module.gd.dal.mysql.list;


import com.flow.demo.framework.common.pojo.PageResult;
import com.flow.demo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.flow.demo.framework.mybatis.core.mapper.BaseMapperX;
import com.flow.demo.module.gd.controller.app.list.vo.ListPageReqVO;
import com.flow.demo.module.gd.dal.dataobject.list.ListDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 用户获奖名单 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface ListMapper extends BaseMapperX<ListDO> {

    default PageResult<ListDO> selectPage(ListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ListDO>()
                .eqIfPresent(ListDO::getGdUserId, reqVO.getGdUserId())
                .eqIfPresent(ListDO::getGdGoodId, reqVO.getGdGoodId())
                .betweenIfPresent(ListDO::getDate, reqVO.getDate())
                .eqIfPresent(ListDO::getReceive, reqVO.getReceive())
                .orderByDesc(ListDO::getId));
    }

    void delete(@Param("id") Integer id);
}
